package HTML::Elemental;

use HTML::TreeBuilder;
use HTML::Element::Library;


use Moose;

has 'elem' => ( is => 'rw', lazy => 1, default => sub { $_[0]->tree->look_down(@{$_[0]->ld}) } ) ;
has 'tree' => ( is => 'rw', required => 1 ) ;
has 'ld'   => ( is => 'rw', required => 1 ) ;
has 'preproc' => ( is => 'rw' ) ;

our $VERSION = '0.01';

sub BUILD {

    my($self)=@_;

    $self->preproc->($self) if $self->preproc;
}

sub add {
    
    my($self)=@_;

    


}


=head1 NAME

HTML::Elemental - templating, presentation and data-oriented HTML::Element methods

=head1 VERSION

Version 0.01

=cut



=head1 SYNOPSIS

We have some sample HTML:

 <UL id="beers">
  <li>x</li>
  <li>y</li>
  <li>z</li>
 </UL>

We have some data:

  my @data = qw(schlitz lowenbrau miller);

We create our object:

  my $UL = HTML::Elemental::UL->new(tree => $tree, ld => [id => 'beers'], preproc => sub { $_[0]->elem->delete_content; }) ;

We populate our list:

  $UL->simple_add($_) for @data;

=head1 DESCRIPTION

HTML::Elemental is an HTML::Element library (quite unlike my earlier L<HTML::Element::Library|HTML::Element::Library>) which
is designed to make it easy (and non-invasive) to present data in HTML format.

It is inspired by the PHP KOOL library:
L<http://www.koolphp.net/support/demos/#koolcombobox.firstlook>


=head1 AUTHOR

Terrence Brannon, C<< <tbone at cpan.org> >>

=head1 BUGS

Please report any bugs or feature requests to C<bug-html-elemental at rt.cpan.org>, or through
the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=HTML-Elemental>.  I will be notified, and then you'll
automatically be notified of progress on your bug as I make changes.




=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc HTML::Elemental


You can also look for information at:

=over 4

=item * RT: CPAN's request tracker

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=HTML-Elemental>

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/HTML-Elemental>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/HTML-Elemental>

=item * Search CPAN

L<http://search.cpan.org/dist/HTML-Elemental/>

=back


=head1 ACKNOWLEDGEMENTS

I profusely thank Stevan Little and Robert 'phaylon' Sedlacek
for their help in #moose on irc.perl.org

I also want to thank the KOOLPHP project. Which is what
inspired this form of HTML::Element processing:
L<http://www.koolphp.net/>



=head1 COPYRIGHT & LICENSE

Copyright 2009 Terrence Brannon, all rights reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.


=cut

use HTML::Elemental::UL;

1; # End of HTML::Elemental
